﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Jarvis.Sensors
{
    class PowerSensor : Sensor
    {
        public PowerSensor()
            : base(1000)
        {
            this.name = "Power Sensor";
        }

        public override void Sense(Object stateInfo)
        {
            PowerStatus p = SystemInformation.PowerStatus;

            if (p.PowerLineStatus == PowerLineStatus.Online)
                this.log("Wall");
            else if (p.PowerLineStatus == PowerLineStatus.Offline)
                this.log("Battery");
            else
                this.log("Unknown");
        }
    }
}
